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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.q: B = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: F = None
        self.q: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.q: B = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: F = None
        self.q: I = None
        self.txt = txt

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

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

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