class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.v: C = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

f.z = c
f.w = c
f.r = b
f.v = b
f.u = m
c.r = m
c.v = k
c.s = d
b.y = k
b.r = m
d.w = m
d.t = j
n.q = m
n.t = d
m.y = k
m.r = b
k.r = b
k.v = i
k.s = d
j.q = b
j.t = d
i.r = b
i.v = k
i.s = d
g.z = k
g.r = m
g.u = m
g.v = b
g.w = c
assert d.t.t.t.q.r.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.v: C = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

f.z = c
f.w = c
f.r = b
f.v = b
f.u = m
c.r = m
c.v = k
c.s = d
b.y = k
b.r = m
d.w = m
d.t = j
n.q = m
n.t = d
m.y = k
m.r = b
k.r = b
k.v = i
k.s = d
j.q = b
j.t = d
i.r = b
i.v = k
i.s = d
g.z = k
g.r = m
g.u = m
g.v = b
g.w = c
assert d.t.t.t.q.r.r.y.txt == "k"