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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.r: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.r: C = None
        self.u: G = None
        self.txt = txt

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

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

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