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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.o: D = None
        self.z: A = None
        self.txt = txt

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

c.t = b
c.w = b
c.z = i
c.p = k
c.q = f
k.o = i
i.o = f
f.z = l
f.x = b
l.x = f
l.s = f
l.o = f
l.z = c
n.t = b
n.z = j
n.p = k
n.w = k
n.q = f
b.o = i
j.o = f
assert n.t.o.o.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.p: B = None
        self.q: D = None
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.o: D = None
        self.z: A = None
        self.txt = txt

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

c.t = b
c.w = b
c.z = i
c.p = k
c.q = f
k.o = i
i.o = f
f.z = l
f.x = b
l.x = f
l.s = f
l.o = f
l.z = c
n.t = b
n.z = j
n.p = k
n.w = k
n.q = f
b.o = i
j.o = f
assert n.t.o.o.z.z.txt == "c"