class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

f.p = n
f.q = b
c.v = m
c.z = e
e.p = k
e.u = j
j.t = e
j.v = k
n.o = f
n.t = b
n.w = b
k.t = e
k.v = j
b.o = f
b.t = n
b.w = n
m.v = c
m.z = e
assert e.p.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

f.p = n
f.q = b
c.v = m
c.z = e
e.p = k
e.u = j
j.t = e
j.v = k
n.o = f
n.t = b
n.w = b
k.t = e
k.v = j
b.o = f
b.t = n
b.w = n
m.v = c
m.z = e
assert e.p.v.v.v.v.txt == "k"