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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: H = None
        self.q: G = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: D = None
        self.r: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: H = None
        self.q: G = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: D = None
        self.r: I = None
        self.txt = txt

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

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

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