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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.x: G = None
        self.s: G = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.u: C = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
n = C("n")
g = D("g")
i = E("i")
k = F("k")
b = G("b")

a.s = k
e.t = k
e.p = k
e.r = i
e.x = b
e.s = b
e.y = a
n.q = g
n.s = e
n.o = a
n.v = a
n.r = i
g.x = b
i.v = e
i.q = a
i.t = a
i.u = n
i.s = k
k.p = i
k.z = n
k.t = n
b.t = k
b.o = e
assert e.p.t.q.x.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.x: G = None
        self.s: G = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.u: C = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
n = C("n")
g = D("g")
i = E("i")
k = F("k")
b = G("b")

a.s = k
e.t = k
e.p = k
e.r = i
e.x = b
e.s = b
e.y = a
n.q = g
n.s = e
n.o = a
n.v = a
n.r = i
g.x = b
i.v = e
i.q = a
i.t = a
i.u = n
i.s = k
k.p = i
k.z = n
k.t = n
b.t = k
b.o = e
assert e.p.t.q.x.t.p.txt == "i"