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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: A = None
        self.q: A = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: F = None
        self.t: D = None
        self.u: B = None
        self.x: F = None
        self.o: B = None
        self.txt = txt

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

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

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

n = A("n")
f = B("f")
i = C("i")
k = D("k")
e = E("e")
j = F("j")
g = A("g")
a = E("a")
d = B("d")

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: A = None
        self.q: A = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: F = None
        self.t: D = None
        self.u: B = None
        self.x: F = None
        self.o: B = None
        self.txt = txt

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

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

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

n = A("n")
f = B("f")
i = C("i")
k = D("k")
e = E("e")
j = F("j")
g = A("g")
a = E("a")
d = B("d")

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