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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
n = C("n")
k = D("k")
h = E("h")
j = F("j")
e = B("e")
g = D("g")

m.x = n
m.s = j
l.z = h
l.y = m
n.s = m
n.v = m
k.o = h
k.x = n
k.s = g
k.r = g
h.t = g
h.y = e
h.z = n
h.v = n
h.s = n
h.p = n
j.s = e
j.y = m
j.v = k
e.z = h
e.y = m
g.o = h
g.x = n
g.s = k
g.r = k
assert n.v.s.v.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
n = C("n")
k = D("k")
h = E("h")
j = F("j")
e = B("e")
g = D("g")

m.x = n
m.s = j
l.z = h
l.y = m
n.s = m
n.v = m
k.o = h
k.x = n
k.s = g
k.r = g
h.t = g
h.y = e
h.z = n
h.v = n
h.s = n
h.p = n
j.s = e
j.y = m
j.v = k
e.z = h
e.y = m
g.o = h
g.x = n
g.s = k
g.r = k
assert n.v.s.v.x.s.x.txt == "n"