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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.z: F = None
        self.y: B = None
        self.s: B = None
        self.p: D = None
        self.txt = txt

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

k = A("k")
c = B("c")
j = C("j")
m = D("m")
e = E("e")
n = F("n")

k.v = e
c.z = m
c.o = k
j.o = e
j.v = n
j.r = n
j.x = k
j.z = c
j.p = m
m.p = c
m.x = e
m.r = n
m.z = k
e.q = n
e.z = n
e.v = j
e.y = c
e.s = c
e.p = m
n.s = j
n.o = k
n.x = k
assert c.z.r.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.z: F = None
        self.y: B = None
        self.s: B = None
        self.p: D = None
        self.txt = txt

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

k = A("k")
c = B("c")
j = C("j")
m = D("m")
e = E("e")
n = F("n")

k.v = e
c.z = m
c.o = k
j.o = e
j.v = n
j.r = n
j.x = k
j.z = c
j.p = m
m.p = c
m.x = e
m.r = n
m.z = k
e.q = n
e.z = n
e.v = j
e.y = c
e.s = c
e.p = m
n.s = j
n.o = k
n.x = k
assert c.z.r.s.r.txt == "n"