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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: A = None
        self.o: F = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.o: C = None
        self.r: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.txt = txt

k = A("k")
a = B("a")
m = C("m")
g = D("g")
j = E("j")
b = F("b")
l = G("l")
e = A("e")
d = D("d")
n = C("n")

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: A = None
        self.o: F = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.o: C = None
        self.r: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.txt = txt

k = A("k")
a = B("a")
m = C("m")
g = D("g")
j = E("j")
b = F("b")
l = G("l")
e = A("e")
d = D("d")
n = C("n")

k.w = g
k.t = n
a.r = j
a.t = m
a.p = n
m.t = d
m.z = l
m.y = k
g.t = j
g.s = k
g.o = b
g.r = a
j.s = l
j.u = l
j.q = l
j.o = m
j.r = m
b.q = j
b.r = d
b.w = k
b.z = g
l.x = j
l.y = k
e.w = g
e.t = m
d.t = j
d.s = e
d.o = b
d.r = a
n.t = d
n.z = l
n.y = k
assert e.w.o.z.t.o.txt == "m"