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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.q: G = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.r: D = None
        self.q: A = None
        self.p: D = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: A = None
        self.u: F = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.q: G = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.r: D = None
        self.q: A = None
        self.p: D = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: A = None
        self.u: F = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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