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

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

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

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

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

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

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

l = A("l")
c = B("c")
h = C("h")
d = D("d")
a = E("a")
e = F("e")
n = G("n")
k = A("k")

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

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

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

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

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

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

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

l = A("l")
c = B("c")
h = C("h")
d = D("d")
a = E("a")
e = F("e")
n = G("n")
k = A("k")

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