class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: H = None
        self.v: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: H = None
        self.q: H = None
        self.y: E = None
        self.s: F = None
        self.u: E = None
        self.r: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: E = None
        self.y: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: G = None
        self.p: A = None
        self.w: A = None
        self.y: G = None
        self.txt = txt

n = A("n")
k = B("k")
g = C("g")
e = D("e")
j = E("j")
i = F("i")
f = G("f")
m = H("m")
d = E("d")

n.z = m
n.x = m
n.v = k
n.r = f
k.z = f
k.o = m
k.q = m
k.r = m
k.y = d
k.u = d
k.s = i
g.u = i
g.p = k
g.r = f
e.v = n
j.v = i
j.t = n
i.u = m
i.o = d
i.y = e
f.v = k
f.z = g
m.s = i
m.z = f
m.y = f
m.p = n
m.w = n
d.v = i
d.t = n
assert e.v.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: H = None
        self.v: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: H = None
        self.q: H = None
        self.y: E = None
        self.s: F = None
        self.u: E = None
        self.r: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: E = None
        self.y: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: G = None
        self.p: A = None
        self.w: A = None
        self.y: G = None
        self.txt = txt

n = A("n")
k = B("k")
g = C("g")
e = D("e")
j = E("j")
i = F("i")
f = G("f")
m = H("m")
d = E("d")

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