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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

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

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

c.u = i
c.v = k
c.o = m
b.r = a
b.q = i
i.w = b
i.s = k
i.o = m
i.u = m
a.x = b
a.r = b
a.t = m
a.v = c
m.w = b
m.s = c
m.o = i
m.u = i
d.x = b
d.r = b
d.t = i
d.v = k
l.x = b
l.r = b
l.t = i
l.v = k
k.u = i
k.v = c
k.o = m
assert a.r.r.v.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

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

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

c.u = i
c.v = k
c.o = m
b.r = a
b.q = i
i.w = b
i.s = k
i.o = m
i.u = m
a.x = b
a.r = b
a.t = m
a.v = c
m.w = b
m.s = c
m.o = i
m.u = i
d.x = b
d.r = b
d.t = i
d.v = k
l.x = b
l.r = b
l.t = i
l.v = k
k.u = i
k.v = c
k.o = m
assert a.r.r.v.u.s.u.txt == "i"