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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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