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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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