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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

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

i.t = n
i.w = n
c.t = a
c.u = a
k.s = b
k.p = b
k.o = i
k.y = a
n.p = c
n.q = c
n.v = c
n.o = i
f.u = i
f.y = i
f.v = k
f.o = c
a.s = b
a.p = n
a.o = i
a.y = k
b.p = c
b.q = c
b.v = c
b.o = i
assert a.o.w.q.t.p.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

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

i.t = n
i.w = n
c.t = a
c.u = a
k.s = b
k.p = b
k.o = i
k.y = a
n.p = c
n.q = c
n.v = c
n.o = i
f.u = i
f.y = i
f.v = k
f.o = c
a.s = b
a.p = n
a.o = i
a.y = k
b.p = c
b.q = c
b.v = c
b.o = i
assert a.o.w.q.t.p.o.w.txt == "n"