class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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