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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

d = A("d")
a = B("a")
e = C("e")
j = D("j")
n = E("n")
k = F("k")
i = G("i")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

d = A("d")
a = B("a")
e = C("e")
j = D("j")
n = E("n")
k = F("k")
i = G("i")

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