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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: C = None
        self.y: G = None
        self.z: E = None
        self.txt = txt

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

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

i = A("i")
b = B("b")
m = C("m")
h = D("h")
g = E("g")
k = F("k")
n = G("n")
f = E("f")

i.s = k
i.p = n
i.r = g
i.y = m
b.r = m
b.z = m
b.u = k
b.x = k
b.w = k
b.s = n
m.t = i
h.q = n
h.y = m
h.s = m
g.p = h
g.s = m
g.y = n
g.z = f
k.x = i
k.s = b
k.q = h
k.t = n
n.z = k
n.s = m
n.o = g
n.p = i
n.u = i
f.p = h
f.s = m
f.y = n
f.z = g
assert i.s.s.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.r: E = None
        self.y: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: C = None
        self.y: G = None
        self.z: E = None
        self.txt = txt

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

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

i = A("i")
b = B("b")
m = C("m")
h = D("h")
g = E("g")
k = F("k")
n = G("n")
f = E("f")

i.s = k
i.p = n
i.r = g
i.y = m
b.r = m
b.z = m
b.u = k
b.x = k
b.w = k
b.s = n
m.t = i
h.q = n
h.y = m
h.s = m
g.p = h
g.s = m
g.y = n
g.z = f
k.x = i
k.s = b
k.q = h
k.t = n
n.z = k
n.s = m
n.o = g
n.p = i
n.u = i
f.p = h
f.s = m
f.y = n
f.z = g
assert i.s.s.z.t.txt == "i"