class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.x: F = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: E = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

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

g = A("g")
c = B("c")
n = C("n")
l = D("l")
j = E("j")
k = F("k")

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: E = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

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

g = A("g")
c = B("c")
n = C("n")
l = D("l")
j = E("j")
k = F("k")

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