class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: B = None
        self.v: B = None
        self.y: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: D = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

h = A("h")
i = B("i")
c = C("c")
g = D("g")
m = E("m")
f = B("f")
a = C("a")
n = E("n")

h.q = c
h.u = g
h.y = g
i.r = m
i.s = n
i.u = n
i.y = c
c.o = h
g.u = a
g.t = i
g.v = i
g.y = m
g.o = h
m.y = a
m.x = g
m.v = n
m.q = c
f.r = m
f.u = m
f.s = n
f.y = c
a.o = h
n.y = c
n.x = g
n.v = m
n.q = a
assert c.o.y.u.o.u.t.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: B = None
        self.v: B = None
        self.y: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: D = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

h = A("h")
i = B("i")
c = C("c")
g = D("g")
m = E("m")
f = B("f")
a = C("a")
n = E("n")

h.q = c
h.u = g
h.y = g
i.r = m
i.s = n
i.u = n
i.y = c
c.o = h
g.u = a
g.t = i
g.v = i
g.y = m
g.o = h
m.y = a
m.x = g
m.v = n
m.q = c
f.r = m
f.u = m
f.s = n
f.y = c
a.o = h
n.y = c
n.x = g
n.v = m
n.q = a
assert c.o.y.u.o.u.t.u.y.txt == "c"