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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = 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.q: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: B = None
        self.t: H = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: F = None
        self.x: E = None
        self.o: A = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.s: B = None
        self.p: B = None
        self.u: G = None
        self.q: B = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

g = A("g")
e = B("e")
i = C("i")
d = D("d")
c = E("c")
a = F("a")
k = G("k")
n = H("n")
f = H("f")

g.x = e
g.p = a
g.o = d
e.r = c
e.z = d
e.o = g
i.z = k
d.y = e
c.q = a
c.w = e
a.o = d
a.z = e
a.v = e
a.t = n
a.u = n
k.r = i
k.s = a
k.x = c
k.o = g
k.p = g
n.v = g
n.x = g
n.z = e
n.s = e
n.p = e
n.q = e
n.u = k
n.r = c
f.v = g
f.x = g
f.z = e
f.s = e
f.p = e
f.q = e
f.u = k
f.r = c
assert g.o.y.z.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = 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.q: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: B = None
        self.t: H = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: F = None
        self.x: E = None
        self.o: A = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.s: B = None
        self.p: B = None
        self.u: G = None
        self.q: B = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

g = A("g")
e = B("e")
i = C("i")
d = D("d")
c = E("c")
a = F("a")
k = G("k")
n = H("n")
f = H("f")

g.x = e
g.p = a
g.o = d
e.r = c
e.z = d
e.o = g
i.z = k
d.y = e
c.q = a
c.w = e
a.o = d
a.z = e
a.v = e
a.t = n
a.u = n
k.r = i
k.s = a
k.x = c
k.o = g
k.p = g
n.v = g
n.x = g
n.z = e
n.s = e
n.p = e
n.q = e
n.u = k
n.r = c
f.v = g
f.x = g
f.z = e
f.s = e
f.p = e
f.q = e
f.u = k
f.r = c
assert g.o.y.z.y.o.txt == "g"