class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: F = None
        self.q: D = None
        self.u: C = None
        self.v: G = None
        self.t: G = None
        self.r: C = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.o: B = None
        self.x: I = None
        self.q: D = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.x: A = None
        self.v: B = None
        self.p: I = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: F = None
        self.q: D = None
        self.u: C = None
        self.v: G = None
        self.t: G = None
        self.r: C = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.o: B = None
        self.x: I = None
        self.q: D = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.x: A = None
        self.v: B = None
        self.p: I = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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

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