class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.q: A = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.r: I = None
        self.o: C = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.w: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.w: G = None
        self.x: G = None
        self.z: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.q: A = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.r: I = None
        self.o: C = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.w: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.w: G = None
        self.x: G = None
        self.z: C = None
        self.txt = txt

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

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