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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.y: G = None
        self.u: G = None
        self.p: E = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.t: D = None
        self.x: F = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: G = None
        self.p: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.y: G = None
        self.u: G = None
        self.p: E = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.t: D = None
        self.x: F = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: G = None
        self.p: A = None
        self.txt = txt

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

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

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