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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: C = None
        self.p: A = None
        self.w: D = None
        self.x: A = None
        self.s: C = None
        self.txt = txt

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

j.u = c
j.s = c
j.o = c
j.w = n
j.z = l
l.u = e
k.w = j
e.o = j
e.v = k
n.x = k
n.v = j
n.o = a
c.v = l
a.q = n
a.u = k
a.s = k
a.p = j
a.x = j
a.w = e
assert l.u.v.w.z.u.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.w: E = None
        self.o: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: C = None
        self.p: A = None
        self.w: D = None
        self.x: A = None
        self.s: C = None
        self.txt = txt

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

j.u = c
j.s = c
j.o = c
j.w = n
j.z = l
l.u = e
k.w = j
e.o = j
e.v = k
n.x = k
n.v = j
n.o = a
c.v = l
a.q = n
a.u = k
a.s = k
a.p = j
a.x = j
a.w = e
assert l.u.v.w.z.u.v.w.txt == "j"