class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: C = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: D = None
        self.q: A = None
        self.r: F = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: G = None
        self.v: D = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

k = A("k")
n = B("n")
m = C("m")
d = D("d")
g = E("g")
h = F("h")
e = G("e")

k.o = g
k.s = m
k.p = d
n.z = h
m.p = k
m.q = k
m.z = d
m.r = h
m.w = n
m.o = g
d.p = m
d.o = m
d.x = e
d.q = g
d.v = g
d.s = n
g.u = e
g.t = e
g.p = m
g.x = m
g.r = n
h.r = k
h.y = e
h.v = d
h.z = m
h.o = g
e.p = k
e.x = d
e.s = n
e.t = g
assert k.s.o.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: C = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: D = None
        self.q: A = None
        self.r: F = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: G = None
        self.v: D = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

k = A("k")
n = B("n")
m = C("m")
d = D("d")
g = E("g")
h = F("h")
e = G("e")

k.o = g
k.s = m
k.p = d
n.z = h
m.p = k
m.q = k
m.z = d
m.r = h
m.w = n
m.o = g
d.p = m
d.o = m
d.x = e
d.q = g
d.v = g
d.s = n
g.u = e
g.t = e
g.p = m
g.x = m
g.r = n
h.r = k
h.y = e
h.v = d
h.z = m
h.o = g
e.p = k
e.x = d
e.s = n
e.t = g
assert k.s.o.x.p.txt == "k"