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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.txt = txt

a = A("a")
i = B("i")
j = C("j")
c = D("c")
d = E("d")
b = C("b")
e = A("e")
h = A("h")
k = A("k")

a.p = i
a.y = d
a.s = e
i.u = b
i.v = d
i.t = d
j.y = d
j.o = c
j.u = c
j.r = b
c.y = e
c.p = j
d.y = i
d.p = i
b.y = d
b.o = c
b.u = c
b.r = j
e.p = i
e.y = d
e.s = a
h.p = i
h.y = d
h.s = e
k.p = i
k.y = d
k.s = h
assert i.u.u.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.txt = txt

a = A("a")
i = B("i")
j = C("j")
c = D("c")
d = E("d")
b = C("b")
e = A("e")
h = A("h")
k = A("k")

a.p = i
a.y = d
a.s = e
i.u = b
i.v = d
i.t = d
j.y = d
j.o = c
j.u = c
j.r = b
c.y = e
c.p = j
d.y = i
d.p = i
b.y = d
b.o = c
b.u = c
b.r = j
e.p = i
e.y = d
e.s = a
h.p = i
h.y = d
h.s = e
k.p = i
k.y = d
k.s = h
assert i.u.u.p.o.txt == "c"