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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
a = C("a")
c = D("c")
j = D("j")
g = B("g")
i = C("i")
b = A("b")

l.t = g
l.p = a
l.s = b
l.o = i
d.u = l
d.t = b
d.x = b
d.w = g
a.w = i
a.o = d
a.s = d
c.w = a
c.t = a
c.y = j
j.w = a
j.t = a
j.y = c
g.u = b
g.t = l
g.x = l
g.w = d
i.w = a
i.o = g
i.s = d
b.t = g
b.p = i
b.o = i
b.s = l
assert d.w.w.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
a = C("a")
c = D("c")
j = D("j")
g = B("g")
i = C("i")
b = A("b")

l.t = g
l.p = a
l.s = b
l.o = i
d.u = l
d.t = b
d.x = b
d.w = g
a.w = i
a.o = d
a.s = d
c.w = a
c.t = a
c.y = j
j.w = a
j.t = a
j.y = c
g.u = b
g.t = l
g.x = l
g.w = d
i.w = a
i.o = g
i.s = d
b.t = g
b.p = i
b.o = i
b.s = l
assert d.w.w.u.s.txt == "b"