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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

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