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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.p: A = None
        self.t: E = None
        self.q: B = None
        self.r: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: G = None
        self.t: B = None
        self.v: E = None
        self.x: D = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.p: A = None
        self.t: E = None
        self.q: B = None
        self.r: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: G = None
        self.t: B = None
        self.v: E = None
        self.x: D = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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