class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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