class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.q: B = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.q: B = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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