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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: A = None
        self.w: G = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: D = None
        self.p: E = None
        self.x: A = None
        self.u: E = None
        self.txt = txt

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

m.x = j
m.z = n
m.s = n
j.x = h
j.t = i
j.u = i
j.w = m
j.v = f
n.t = h
n.o = f
i.w = m
i.x = f
k.p = h
k.w = h
k.t = m
k.x = n
k.z = j
f.z = j
f.v = m
f.s = i
h.t = f
h.z = i
h.p = k
h.u = k
h.x = m
assert m.z.t.p.x.t.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: A = None
        self.w: G = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: D = None
        self.p: E = None
        self.x: A = None
        self.u: E = None
        self.txt = txt

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

m.x = j
m.z = n
m.s = n
j.x = h
j.t = i
j.u = i
j.w = m
j.v = f
n.t = h
n.o = f
i.w = m
i.x = f
k.p = h
k.w = h
k.t = m
k.x = n
k.z = j
f.z = j
f.v = m
f.s = i
h.t = f
h.z = i
h.p = k
h.u = k
h.x = m
assert m.z.t.p.x.t.z.x.txt == "f"