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

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

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

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

i = A("i")
m = B("m")
f = C("f")
j = D("j")
l = C("l")
a = D("a")
g = A("g")
n = B("n")

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

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

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

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

i = A("i")
m = B("m")
f = C("f")
j = D("j")
l = C("l")
a = D("a")
g = A("g")
n = B("n")

i.w = l
i.o = g
i.u = j
i.s = j
m.s = n
m.r = n
m.v = j
m.t = f
f.t = l
f.y = n
f.p = i
j.t = m
j.r = a
j.q = a
l.t = f
l.y = n
l.p = g
a.t = m
a.r = j
a.q = j
g.w = l
g.o = i
g.u = j
g.s = a
n.s = m
n.r = m
n.v = j
n.t = f
assert a.r.t.r.s.r.v.t.t.txt == "f"