class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: D = None
        self.x: A = None
        self.t: C = None
        self.q: G = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: C = None
        self.w: C = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: B = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

f = A("f")
c = B("c")
g = C("g")
n = D("n")
e = E("e")
m = F("m")
k = G("k")
b = A("b")
h = C("h")
i = E("i")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: D = None
        self.x: A = None
        self.t: C = None
        self.q: G = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: C = None
        self.w: C = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: B = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

f = A("f")
c = B("c")
g = C("g")
n = D("n")
e = E("e")
m = F("m")
k = G("k")
b = A("b")
h = C("h")
i = E("i")

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