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

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

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

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

f = A("f")
k = B("k")
a = C("a")
l = D("l")
b = C("b")
j = C("j")
e = C("e")
m = A("m")
d = C("d")
g = A("g")

f.u = j
f.w = m
k.u = l
k.o = e
a.y = j
a.r = f
a.t = k
l.w = k
l.y = a
l.q = g
l.v = f
b.y = d
b.r = g
b.t = k
j.y = a
j.r = m
j.t = k
e.y = d
e.r = g
e.t = k
m.u = j
m.w = f
d.y = a
d.r = m
d.t = k
g.u = j
g.w = m
assert d.r.u.t.o.y.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: A = None
        self.txt = txt

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

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

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

f = A("f")
k = B("k")
a = C("a")
l = D("l")
b = C("b")
j = C("j")
e = C("e")
m = A("m")
d = C("d")
g = A("g")

f.u = j
f.w = m
k.u = l
k.o = e
a.y = j
a.r = f
a.t = k
l.w = k
l.y = a
l.q = g
l.v = f
b.y = d
b.r = g
b.t = k
j.y = a
j.r = m
j.t = k
e.y = d
e.r = g
e.t = k
m.u = j
m.w = f
d.y = a
d.r = m
d.t = k
g.u = j
g.w = m
assert d.r.u.t.o.y.y.y.t.txt == "k"