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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: F = None
        self.v: A = None
        self.t: A = None
        self.y: G = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: F = None
        self.v: A = None
        self.t: A = None
        self.y: G = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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