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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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