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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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

b = A("b")
e = B("e")
a = C("a")
k = D("k")
c = B("c")
m = C("m")
d = C("d")
l = B("l")
h = B("h")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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

b = A("b")
e = B("e")
a = C("a")
k = D("k")
c = B("c")
m = C("m")
d = C("d")
l = B("l")
h = B("h")

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