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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

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

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

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

e.s = k
e.x = k
e.o = g
e.v = n
e.q = f
n.q = j
j.t = k
j.p = k
f.r = k
f.t = k
f.q = k
f.p = e
k.x = j
k.q = j
g.r = n
g.o = j
g.x = k
assert g.x.q.p.txt == "k"