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

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

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

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

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

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

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

j.v = e
j.p = e
j.s = g
j.z = h
j.w = h
j.o = n
e.y = h
e.t = j
i.v = g
g.s = i
g.w = j
g.x = n
g.r = n
n.x = h
h.q = n
h.v = n
k.y = h
k.t = j
assert g.s.v.w.s.w.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.z: F = None
        self.p: B = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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