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

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

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

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

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

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

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

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

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

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

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

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

i.r = c
i.z = f
j.o = f
j.q = n
n.t = k
n.p = f
n.r = a
a.z = f
a.s = j
a.v = d
d.t = k
d.r = a
d.w = n
d.p = i
k.z = j
k.s = j
k.v = d
f.o = j
f.q = n
c.z = f
c.s = f
c.v = d
assert k.s.o.o.q.p.o.q.t.txt == "k"