class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: B = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: G = None
        self.y: A = None
        self.r: D = None
        self.z: B = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: G = None
        self.w: I = None
        self.o: B = None
        self.s: B = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: I = None
        self.t: B = None
        self.z: A = None
        self.o: B = None
        self.p: A = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

h = A("h")
n = B("n")
e = C("e")
f = D("f")
d = E("d")
j = F("j")
a = G("a")
g = H("g")
b = I("b")

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: G = None
        self.y: A = None
        self.r: D = None
        self.z: B = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: G = None
        self.w: I = None
        self.o: B = None
        self.s: B = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: I = None
        self.t: B = None
        self.z: A = None
        self.o: B = None
        self.p: A = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

h = A("h")
n = B("n")
e = C("e")
f = D("f")
d = E("d")
j = F("j")
a = G("a")
g = H("g")
b = I("b")

h.r = a
h.z = n
h.t = f
h.q = d
n.r = b
n.t = f
n.p = a
e.q = f
e.r = f
e.t = a
e.y = h
e.z = n
e.p = b
f.p = a
f.u = e
f.o = e
d.v = b
d.w = b
d.t = a
d.o = n
d.s = n
d.y = f
d.x = h
j.p = g
j.z = g
j.u = d
j.o = h
j.q = h
j.r = b
j.x = f
j.w = f
a.v = g
a.r = n
a.s = n
g.u = b
g.s = b
g.y = b
g.t = n
g.o = n
g.z = h
g.p = h
g.v = j
b.x = n
assert n.r.x.r.x.r.x.txt == "n"