class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: B = None
        self.q: D = None
        self.y: G = None
        self.r: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

j = A("j")
a = B("a")
c = C("c")
h = D("h")
b = E("b")
l = F("l")
i = G("i")
n = E("n")

j.w = n
j.z = a
j.q = h
j.y = i
j.r = c
j.o = c
a.v = h
a.y = c
a.o = c
a.p = n
c.u = l
c.r = h
h.p = c
h.y = c
h.q = i
h.x = b
b.z = i
l.q = j
l.v = j
l.z = a
l.o = a
l.p = b
l.w = h
l.x = i
i.r = h
n.z = i
assert a.v.x.z.r.q.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: B = None
        self.q: D = None
        self.y: G = None
        self.r: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

j = A("j")
a = B("a")
c = C("c")
h = D("h")
b = E("b")
l = F("l")
i = G("i")
n = E("n")

j.w = n
j.z = a
j.q = h
j.y = i
j.r = c
j.o = c
a.v = h
a.y = c
a.o = c
a.p = n
c.u = l
c.r = h
h.p = c
h.y = c
h.q = i
h.x = b
b.z = i
l.q = j
l.v = j
l.z = a
l.o = a
l.p = b
l.w = h
l.x = i
i.r = h
n.z = i
assert a.v.x.z.r.q.r.q.txt == "i"