class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.u: B = None
        self.s: B = None
        self.y: E = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: A = None
        self.u: C = None
        self.t: C = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

b = A("b")
h = B("h")
a = C("a")
c = D("c")
g = E("g")
i = F("i")
d = G("d")
e = H("e")

b.t = a
b.x = a
b.q = h
b.u = h
b.s = h
b.y = g
b.v = g
h.p = b
h.x = e
a.z = b
a.u = c
a.x = d
c.q = i
c.y = i
c.z = g
c.u = b
c.o = e
c.t = e
g.q = b
i.t = e
i.w = e
d.z = g
d.x = b
d.v = b
d.u = a
d.t = a
e.p = g
e.t = h
e.q = h
assert g.q.y.q.y.q.x.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.u: B = None
        self.s: B = None
        self.y: E = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: A = None
        self.u: C = None
        self.t: C = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

b = A("b")
h = B("h")
a = C("a")
c = D("c")
g = E("g")
i = F("i")
d = G("d")
e = H("e")

b.t = a
b.x = a
b.q = h
b.u = h
b.s = h
b.y = g
b.v = g
h.p = b
h.x = e
a.z = b
a.u = c
a.x = d
c.q = i
c.y = i
c.z = g
c.u = b
c.o = e
c.t = e
g.q = b
i.t = e
i.w = e
d.z = g
d.x = b
d.v = b
d.u = a
d.t = a
e.p = g
e.t = h
e.q = h
assert g.q.y.q.y.q.x.z.x.txt == "a"