Question: When I was Your Man was written by Bruno Mars on what album?
Context: "Young Girls" is a song by American singer-songwriter Bruno Mars.  It was composed by Bruno Mars, Philip Lawrence and Ari Levine, Jeff Bhasker, Emile Haynie, with additional songwriter credits by Mac Davis, for Mars' second studio album "Unorthodox Jukebox" (2012).  "Young Girls" is a midtempo pop ballad, which incorporates elements of doo-wop, and reminiscent of the song "It Will Rain" and Lana Del Rey's work.  Its music is largely based on drums, synths, piano and "bits of" electronic music.  "Young Girls" was released as the first promotional single and later as the fifth overall single from "Unorthodox Jukebox", being first serviced to Contemporary hit radio in Australia on November 26, 2013. "When I Was Your Man" is a song recorded by American singer and songwriter Bruno Mars for his second studio album, "Unorthodox Jukebox" (2012).  Atlantic Records released the song as the third promotional single and as the second official single, taken from the album, to mainstream radio in the United States on January 15, 2013.  "When I Was Your Man" was written by Bruno Mars, Philip Lawrence, Ari Levine and Andrew Wyatt; with Mars, Lawrence and Levine credited for composing the song as well. "Lift Off" is a song by Jay-Z and Kanye West featuring American recording artist Beyoncé.  It was written by Kanye West, Jay-Z, Jeff Bhasker, Mike Dean, Bruno Mars and Seal, while production was handled by West, Bhasker, Mike Dean, Pharrell, Q-Tip, and Don Jazzy for Jay-Z' s and West' s collaboration album, "Watch the Throne" (2011).  The song was rumored to be released as the lead single from the album containing additional vocals by Bruno Mars.  However, Mars never appeared on the song and it was sent to urban contemporary radio on August 23, 2011. "The Lazy Song" is a song recorded by American singer-songwriter Bruno Mars for his debut studio album "Doo-Wops & Hooligans" (2010).  It was serviced to contemporary hit radios in the United States on February 15, 2011 as the album's third single by Atlantic and Elektra.  Development of "The Lazy Song" began while Bruno Mars, Philip Lawrence and Ari Levine were hanging around the studio and didn’t feel like working.  Mars wrote the song in collaboration with singer-songwriter K'naan and his production team The Smeezingtons, who also produced the track.  Musically, "The Lazy Song" has been described as borrowing "heavily from roots reggae", while lyrically it is an anthem to laziness. "Talking to the Moon" is a song by American singer-songwriter Bruno Mars from his debut studio album, "Doo-Wops & Hooligans" (2010).  The song was first unveiled on Mars' debut extended play, "It's Better If You Don't Understand" (2010), as its last track.  It was written by Bruno Mars, Philip Lawrence, Ari Levine, Albert Winkler, and Jeff Bhasker, while production was handled by The Smeezingtons in collaboration with Bhasker.  "Talking to the Moon", serves as the record's sixth track, and remains an R&B power ballad song, and its lyrics regard a failed relationship, solitude, and sadness.  Instrumentally, the track relies on drum percussion and piano. American singer-songwriter Bruno Mars has written and recorded songs for his studio albums, "Doo-Wops & Hooligans" (2010) and "Unorthodox Jukebox" (2012), and has written songs for other singers.  The Smeezingtons (Bruno Mars, Philip Lawrence, Ari Levine) worked in the majority of the songs in Mars' debut studio album, including writing "Count on Me" and "Marry You" together.  The team collaborated with Khari Cain and Khalil Walton on the album's lead single "Just the Way You Are", peaking at number one on the "Billboard" Hot 100.  Mars explained "I wasn't thinking of anything deep or poetic.  I was telling a story."  Mars co-wrote and co-produced the song "Talking to the Moon" with Grammy Award winning producer Jeff Bhasker.  The single "Grenade", was conceptualised after Mars heard an unreleased track with similar lyrical themes.  Mars' follow-up album, in addition to reunite collaborators from his previous album, such as The Smeezingtons and Jeff Bhasker, included new composers, such as Mark Ronson and Emile Haynie.  All of these producers worked on the lead single "Locked Out of Heaven".  The song concerns a relationship infused with positive emotion and good sex.  The idea behind the second single, "When I Was Your Man", is the regret of letting a girl get away.  Several of the songs were written solely by his production team, including the lead single, "If I Knew" and the single "Gorilla" Peter Gene Hernandez (born October 8, 1985), known professionally as Bruno Mars ( ), is an American singer-songwriter, multi-instrumentalist, record producer, and choreographer.  Born and raised in Honolulu, Hawaii, by a family of musicians, Mars began making music at a young age and performed in various musical venues in his hometown throughout his childhood.  He graduated from high school and moved to Los Angeles to pursue a musical career.  After being dropped by Motown Records, Mars signed a recording contract with Atlantic Records in 2009. "Moonshine" is a song recorded by American singer-songwriter Bruno Mars for his second studio album "Unorthodox Jukebox" (2012).  It was written by Bruno Mars, Philip Lawrence, Ari Levine, Andrew Wyatt, Jeff Bhasker and Mark Ronson who also served as its producer along with the former three, under their alias, The Smeezingtons, and Bhasker.  "Moonshine" is a midtempo pop, power pop and R&B record.  In addition to be heavily influenced by quiet storm and dance-pop styles, as well as, presenting a "disco groove".  Development of "Moonshine" began while Mars, Ronson and Bhasker "went out one night" and drunk moonshine all night long.  When they returned to the studio they started jamming, while Mars screamed "Moonshine, take us to the stars!" . American singer and songwriter Bruno Mars has recorded songs for one EP and two studio albums, some of which were collaborations with others.  Shortly after moving to Los Angeles, Mars signed to Motown Records in 2004 and was dropped shortly afterwards, he also held a conversation with Will.i.am's management which turned out fruitless.  After these two unsuccessful events, the singer signed a second contract with record label Atlantic in 2009.  Before becoming a successful solo artist, Mars was an acknowledged music producer, co-founding the production team The Smeezingtons.  Bruno Mars has been named one of the greatest artist of all time. In 2011, 22 albums advanced to number one on the Mega Album Top 100, the official Dutch albums chart.  The first album to appear on the Album Top 100 that year was Caro Emerald's "Deleted Scenes from the Cutting Room Floor", the last being "Christmas" by Michael Bublé.  Artists and bands who had an album reach number one on the chart for at least one week were Caro Emerald, , Marco Borsato, Bruno Mars, Adele, BLØF, Ben Saunders, Guus Meeuwis, Anouk, Amy Winehouse, Red Hot Chili Peppers, Gerard Joling, Gordon, Rene Froger, Jeroen van der Boom, De Toppers, SuperHeavy, De Dijk, Coldplay, Frans Bauer, Snow Patrol, K3, Nick & Simon and Michael Bublé, and out of these artists, Bruno Mars, BLØF, Ben Saunders, SuperHeavy and Snow Patrol had achieved a number-one album for the first time.  Adele's "21" was the best-performing album of 2011, topping the Album Top 100's 2011 year-end chart.
Answer: "Unorthodox Jukebox"