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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.v: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.v: F = None
        self.w: F = None
        self.txt = txt

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

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