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

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

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

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

e = A("e")
b = B("b")
j = C("j")
d = D("d")
n = C("n")
i = B("i")
m = D("m")
l = A("l")
f = C("f")

e.s = d
e.y = l
e.w = m
b.v = m
b.u = d
b.r = e
b.o = e
j.q = n
j.u = i
d.x = e
d.r = l
d.t = m
d.u = m
n.q = f
n.u = b
i.v = m
i.u = d
i.r = e
i.o = e
m.x = l
m.r = e
m.t = d
m.u = d
l.s = d
l.y = e
l.w = m
f.q = n
f.u = i
assert j.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.w: D = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
j = C("j")
d = D("d")
n = C("n")
i = B("i")
m = D("m")
l = A("l")
f = C("f")

e.s = d
e.y = l
e.w = m
b.v = m
b.u = d
b.r = e
b.o = e
j.q = n
j.u = i
d.x = e
d.r = l
d.t = m
d.u = m
n.q = f
n.u = b
i.v = m
i.u = d
i.r = e
i.o = e
m.x = l
m.r = e
m.t = d
m.u = d
l.s = d
l.y = e
l.w = m
f.q = n
f.u = i
assert j.q.q.q.q.txt == "f"