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

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

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

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

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

l.s = c
n.v = e
n.t = a
a.r = e
a.q = j
a.z = g
a.x = l
j.u = e
j.v = l
j.y = d
b.r = n
b.q = j
b.z = l
b.x = l
d.r = n
d.q = j
d.z = g
d.x = l
g.s = c
e.v = n
e.t = b
c.v = e
c.t = b
assert l.s.v.v.v.t.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

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

l.s = c
n.v = e
n.t = a
a.r = e
a.q = j
a.z = g
a.x = l
j.u = e
j.v = l
j.y = d
b.r = n
b.q = j
b.z = l
b.x = l
d.r = n
d.q = j
d.z = g
d.x = l
g.s = c
e.v = n
e.t = b
c.v = e
c.t = b
assert l.s.v.v.v.t.q.v.txt == "l"