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

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

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

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

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

k.t = e
k.s = e
e.w = m
e.t = j
e.o = a
e.q = n
g.v = m
m.w = h
m.r = k
m.x = a
m.q = d
h.w = m
h.q = m
h.r = k
h.x = e
j.v = m
a.w = m
a.t = l
a.o = e
a.q = j
d.w = h
d.r = k
d.x = a
d.q = m
l.v = m
n.v = m
assert g.v.r.t.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

k.t = e
k.s = e
e.w = m
e.t = j
e.o = a
e.q = n
g.v = m
m.w = h
m.r = k
m.x = a
m.q = d
h.w = m
h.q = m
h.r = k
h.x = e
j.v = m
a.w = m
a.t = l
a.o = e
a.q = j
d.w = h
d.r = k
d.x = a
d.q = m
l.v = m
n.v = m
assert g.v.r.t.o.o.o.o.txt == "e"