class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: E = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.w: F = None
        self.o: D = None
        self.s: F = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
f = C("f")
l = D("l")
b = E("b")
n = F("n")
m = G("m")

k.y = m
k.w = b
k.v = b
k.q = f
i.z = n
i.q = m
f.w = l
l.u = i
l.p = n
l.y = n
l.s = m
l.r = b
l.x = b
b.r = k
b.p = f
b.w = n
b.s = n
b.o = l
n.o = f
m.x = k
m.z = k
assert n.o.w.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: E = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.w: F = None
        self.o: D = None
        self.s: F = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
f = C("f")
l = D("l")
b = E("b")
n = F("n")
m = G("m")

k.y = m
k.w = b
k.v = b
k.q = f
i.z = n
i.q = m
f.w = l
l.u = i
l.p = n
l.y = n
l.s = m
l.r = b
l.x = b
b.r = k
b.p = f
b.w = n
b.s = n
b.o = l
n.o = f
m.x = k
m.z = k
assert n.o.w.s.z.txt == "k"