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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: D = None
        self.s: A = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: D = None
        self.s: A = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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