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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.o: F = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.o: F = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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