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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.z: E = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.u: D = None
        self.x: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

c = A("c")
l = B("l")
f = C("f")
a = D("a")
m = E("m")
g = F("g")

c.v = m
c.o = f
c.s = f
c.t = f
l.u = c
l.t = c
l.z = m
l.y = f
f.q = g
f.z = c
f.o = c
f.w = l
f.y = l
f.x = m
a.v = l
a.x = l
a.u = g
m.q = g
g.q = c
g.x = c
g.v = m
g.p = m
g.u = a
g.z = f
assert f.w.z.q.x.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.s: C = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.z: E = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.u: D = None
        self.x: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

c = A("c")
l = B("l")
f = C("f")
a = D("a")
m = E("m")
g = F("g")

c.v = m
c.o = f
c.s = f
c.t = f
l.u = c
l.t = c
l.z = m
l.y = f
f.q = g
f.z = c
f.o = c
f.w = l
f.y = l
f.x = m
a.v = l
a.x = l
a.u = g
m.q = g
g.q = c
g.x = c
g.v = m
g.p = m
g.u = a
g.z = f
assert f.w.z.q.x.v.q.txt == "g"