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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

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

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

m.x = f
m.p = l
m.u = c
m.o = a
c.r = e
c.w = e
c.s = b
c.x = l
e.s = a
e.r = l
e.q = l
e.t = b
a.p = b
a.v = n
n.x = m
n.p = l
n.u = c
n.o = k
l.r = b
l.w = b
l.s = e
l.x = c
b.s = a
b.r = l
b.q = l
b.t = e
k.p = b
k.v = n
f.x = m
f.p = l
f.u = c
f.o = a
assert a.v.p.w.t.t.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

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

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

m.x = f
m.p = l
m.u = c
m.o = a
c.r = e
c.w = e
c.s = b
c.x = l
e.s = a
e.r = l
e.q = l
e.t = b
a.p = b
a.v = n
n.x = m
n.p = l
n.u = c
n.o = k
l.r = b
l.w = b
l.s = e
l.x = c
b.s = a
b.r = l
b.q = l
b.t = e
k.p = b
k.v = n
f.x = m
f.p = l
f.u = c
f.o = a
assert a.v.p.w.t.t.t.s.txt == "a"