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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.y: A = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.t: B = None
        self.r: B = None
        self.txt = txt

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

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

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

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

f.s = c
f.q = c
f.z = h
h.t = l
h.r = l
h.v = n
h.y = f
h.w = f
n.y = f
n.q = m
n.t = h
n.r = h
l.o = m
l.s = m
l.t = m
l.v = f
l.x = n
c.s = m
m.r = f
m.z = c
assert n.y.z.v.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.y: A = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.t: B = None
        self.r: B = None
        self.txt = txt

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

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

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

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

f.s = c
f.q = c
f.z = h
h.t = l
h.r = l
h.v = n
h.y = f
h.w = f
n.y = f
n.q = m
n.t = h
n.r = h
l.o = m
l.s = m
l.t = m
l.v = f
l.x = n
c.s = m
m.r = f
m.z = c
assert n.y.z.v.q.z.txt == "c"