class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.t: F = None
        self.p: B = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: H = None
        self.x: A = None
        self.o: H = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: H = None
        self.p: B = None
        self.x: G = None
        self.u: C = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: B = None
        self.q: C = None
        self.t: C = None
        self.w: C = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.t: G = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: H = None
        self.x: A = None
        self.o: H = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: H = None
        self.p: B = None
        self.x: G = None
        self.u: C = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: B = None
        self.q: C = None
        self.t: C = None
        self.w: C = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.t: G = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

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