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

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

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

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

e = A("e")
m = B("m")
c = C("c")
k = D("k")
h = A("h")
l = B("l")
j = B("j")
a = D("a")
f = A("f")

e.t = j
e.u = k
m.q = c
m.s = c
m.t = j
m.r = f
c.r = f
k.x = h
k.q = a
k.o = a
k.v = c
h.t = j
h.u = k
l.q = c
l.s = c
l.t = m
l.r = e
j.q = c
j.s = c
j.t = m
j.r = e
a.x = h
a.q = k
a.o = k
a.v = c
f.t = l
f.u = a
assert l.t.t.t.r.u.x.u.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.txt = txt

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

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

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

e = A("e")
m = B("m")
c = C("c")
k = D("k")
h = A("h")
l = B("l")
j = B("j")
a = D("a")
f = A("f")

e.t = j
e.u = k
m.q = c
m.s = c
m.t = j
m.r = f
c.r = f
k.x = h
k.q = a
k.o = a
k.v = c
h.t = j
h.u = k
l.q = c
l.s = c
l.t = m
l.r = e
j.q = c
j.s = c
j.t = m
j.r = e
a.x = h
a.q = k
a.o = k
a.v = c
f.t = l
f.u = a
assert l.t.t.t.r.u.x.u.x.t.txt == "j"