class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: B = None
        self.t: D = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: E = None
        self.txt = txt

d = A("d")
e = B("e")
k = C("k")
f = D("f")
n = E("n")
h = A("h")
i = E("i")
j = B("j")
g = B("g")
c = C("c")

d.v = n
d.s = n
d.q = j
d.t = f
d.z = h
e.o = n
k.y = h
k.x = i
k.s = i
k.r = d
k.u = f
f.o = g
n.q = e
n.z = i
h.v = i
h.s = i
h.q = g
h.t = f
h.z = d
i.q = e
i.z = n
j.o = n
g.o = n
c.y = d
c.x = n
c.s = n
c.r = h
c.u = f
assert h.z.z.s.z.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: B = None
        self.t: D = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: E = None
        self.txt = txt

d = A("d")
e = B("e")
k = C("k")
f = D("f")
n = E("n")
h = A("h")
i = E("i")
j = B("j")
g = B("g")
c = C("c")

d.v = n
d.s = n
d.q = j
d.t = f
d.z = h
e.o = n
k.y = h
k.x = i
k.s = i
k.r = d
k.u = f
f.o = g
n.q = e
n.z = i
h.v = i
h.s = i
h.q = g
h.t = f
h.z = d
i.q = e
i.z = n
j.o = n
g.o = n
c.y = d
c.x = n
c.s = n
c.r = h
c.u = f
assert h.z.z.s.z.q.o.txt == "n"