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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: H = None
        self.z: F = None
        self.y: F = None
        self.v: A = None
        self.o: F = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.w: F = None
        self.u: D = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

n = A("n")
k = B("k")
e = C("e")
l = D("l")
c = E("c")
g = F("g")
f = G("f")
b = H("b")

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: H = None
        self.z: F = None
        self.y: F = None
        self.v: A = None
        self.o: F = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.w: F = None
        self.u: D = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

n = A("n")
k = B("k")
e = C("e")
l = D("l")
c = E("c")
g = F("g")
f = G("f")
b = H("b")

n.x = e
n.z = k
n.p = l
k.s = f
k.w = b
k.z = g
k.y = g
k.o = g
k.v = n
k.q = l
k.u = l
e.p = g
e.s = g
e.w = g
e.u = l
e.t = c
l.v = k
l.s = k
l.q = e
l.t = e
l.p = e
l.y = f
l.r = c
c.o = n
c.w = n
g.q = n
g.t = n
g.x = n
f.q = k
b.o = k
b.v = e
assert b.v.t.w.p.t.txt == "e"