class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: I = None
        self.o: I = None
        self.u: E = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: H = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: I = None
        self.q: I = None
        self.p: I = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: I = None
        self.o: I = None
        self.u: E = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: H = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: I = None
        self.q: I = None
        self.p: I = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: C = None
        self.txt = txt

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

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