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

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

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

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

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

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

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

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

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

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

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

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

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

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

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