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

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

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

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

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

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

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

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

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

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

b.t = k
a.x = l
a.u = c
a.s = k
j.q = a
j.y = b
j.o = b
j.x = e
l.y = j
l.x = i
c.x = l
c.u = e
c.s = k
k.q = e
k.y = b
k.o = g
k.x = a
i.x = l
i.u = c
i.s = j
e.x = l
e.u = a
e.s = j
g.t = j
assert l.y.x.s.x.x.y.x.x.txt == "l"