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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.s: F = None
        self.y: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.s: F = None
        self.y: C = None
        self.o: C = None
        self.txt = txt

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

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

c.v = m
c.x = m
h.w = c
h.y = a
h.q = a
h.z = l
h.u = m
m.s = c
m.v = c
m.z = e
f.v = c
f.r = l
f.x = e
l.u = f
l.w = f
l.s = a
l.y = m
l.o = m
e.o = h
a.o = h
assert e.o.z.s.o.w.txt == "c"