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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: D = None
        self.z: F = None
        self.y: B = None
        self.t: G = None
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: D = None
        self.z: F = None
        self.y: B = None
        self.t: G = None
        self.u: D = None
        self.txt = txt

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

j.z = e
j.u = g
j.t = m
j.p = l
l.o = j
m.v = g
m.r = j
m.x = e
m.w = h
e.p = l
g.r = j
g.q = n
h.w = j
n.q = l
n.y = l
n.p = e
n.u = e
n.z = h
n.t = k
k.q = l
k.y = l
k.p = e
k.u = e
k.z = h
k.t = n
assert m.x.p.o.t.txt == "m"