class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: C = None
        self.p: E = None
        self.o: C = None
        self.s: C = None
        self.w: F = None
        self.y: G = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.p: A = None
        self.v: B = None
        self.y: A = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.x: F = None
        self.t: H = None
        self.s: B = None
        self.u: D = None
        self.z: D = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.p: A = None
        self.v: B = None
        self.y: A = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.x: F = None
        self.t: H = None
        self.s: B = None
        self.u: D = None
        self.z: D = None
        self.y: C = None
        self.txt = txt

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

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

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