A Montana judge has ordered two men who allegedly lied about having served in the military in an effort to get special treatment in veterans court to wear “I stole valor” signs as part of their parole conditions.

On Friday, Cascade County District Court Judge Greg Pinski sentenced 33-year-old Troy Allan Nelson and 28-year-old Ryan Patrick Morris to prison for unrelated crimes. But he also handed out more menial punishments for allegedly claiming they were veterans when they weren’t, Cascade County Attorney Joshua Racki, who attended the sentencing, tells TIME.

Pinski ordered that Nelson and Morris must:

Handwrite the names of the 6,756 U.S. soldiers killed in Afghanistan and Iraq

Handwrite the obituaries of the 40 Montanans who died in the Iraq and Afghanistan wars

Serve 441 hours of community service

Write letters of apology to multiple veteran organizations.

Attend the Montana Veterans Memorial on Memorial Day and Veterans Day every year during the suspended portions of their sentences for 8 hours wearing a placard that reads “I am a Liar. I am not a veteran. I stole valor. I have dishonored veterans”

Pinski sentenced Nelson to 5 years for felony drug possession with 2 years suspended. Morris was sentenced to 10 years in prison with 3 years suspended for violating terms of parole for a felony burglary conviction.

According to Racki, after the men serve their sentences they must complete Pinski’s requirements before being considered for parole.

According to Associated Press, in 2016 Morris claimed to have completed seven combat tours in Iraq and Afghanistan. Morris told the courts he suffered from PTSD and had to have his hip replaced after being injured by an IED, AP reports. Nelson had managed to enroll in the veterans court program before it was discovered he was not a veteran, the Great Falls Tribune reported.

Pinski told the two men, who apologized to service members for lying in court, the conditions were meant to send them a message.

“I want to make sure that my message is received loud and clear by these two defendants,” Pinski said, according to the Tribune. “You’ve been nothing but disrespectful in your conduct. You certainly have not respected the Army. You’ve not respected the veterans. You’ve not respected the court. And you haven’t respected yourselves.”

The veterans court program supports veterans entering the criminal justice system with treatment plans instead of jail that focuses on service-related issues like PTSD, traumatic brain injury and substance abuse.

Write to Gina Martinez at gina.martinez@time.com.