class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: G = None
        self.v: H = None
        self.w: B = None
        self.u: C = None
        self.z: F = None
        self.x: C = None
        self.q: I = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: I = None
        self.x: G = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: C = None
        self.o: G = None
        self.s: C = None
        self.t: H = None
        self.u: B = None
        self.w: A = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: C = None
        self.t: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: I = None
        self.x: G = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: C = None
        self.o: G = None
        self.s: C = None
        self.t: H = None
        self.u: B = None
        self.w: A = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: C = None
        self.t: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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