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

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

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

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

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

a = A("a")
m = B("m")
f = C("f")
c = D("c")
n = E("n")
e = E("e")
d = E("d")
k = A("k")
l = E("l")

a.u = k
a.y = k
a.o = c
m.t = f
m.o = f
m.p = k
f.v = k
c.o = l
c.y = n
n.w = c
e.w = c
d.w = c
k.u = a
k.y = a
k.o = c
l.w = c
assert m.p.u.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

a = A("a")
m = B("m")
f = C("f")
c = D("c")
n = E("n")
e = E("e")
d = E("d")
k = A("k")
l = E("l")

a.u = k
a.y = k
a.o = c
m.t = f
m.o = f
m.p = k
f.v = k
c.o = l
c.y = n
n.w = c
e.w = c
d.w = c
k.u = a
k.y = a
k.o = c
l.w = c
assert m.p.u.y.o.txt == "c"