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

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

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

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

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

j = A("j")
f = B("f")
c = C("c")
k = D("k")
g = E("g")
e = E("e")

j.o = f
j.y = k
f.q = k
f.u = c
c.u = e
c.s = f
c.t = f
k.p = j
g.v = f
g.t = k
g.p = j
e.v = f
e.t = k
e.p = j
assert c.t.u.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.txt = txt

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

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

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

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

j = A("j")
f = B("f")
c = C("c")
k = D("k")
g = E("g")
e = E("e")

j.o = f
j.y = k
f.q = k
f.u = c
c.u = e
c.s = f
c.t = f
k.p = j
g.v = f
g.t = k
g.p = j
e.v = f
e.t = k
e.p = j
assert c.t.u.u.v.u.txt == "c"