class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.s: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.s: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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