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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.x: H = None
        self.p: A = None
        self.y: H = None
        self.t: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: J = None
        self.v: F = None
        self.x: J = None
        self.s: B = None
        self.z: B = None
        self.p: E = None
        self.q: H = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: J = None
        self.v: B = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: J = None
        self.o: I = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: I = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: H = None
        self.y: B = None
        self.q: J = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: E = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: C = None
        self.z: G = None
        self.o: H = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.q: D = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

d = A("d")
c = B("c")
e = C("e")
a = D("a")
f = E("f")
k = F("k")
i = G("i")
m = H("m")
j = I("j")
n = J("n")

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.x: H = None
        self.p: A = None
        self.y: H = None
        self.t: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: J = None
        self.v: F = None
        self.x: J = None
        self.s: B = None
        self.z: B = None
        self.p: E = None
        self.q: H = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: J = None
        self.v: B = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: J = None
        self.o: I = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: I = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: H = None
        self.y: B = None
        self.q: J = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: E = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: C = None
        self.z: G = None
        self.o: H = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.q: D = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

d = A("d")
c = B("c")
e = C("e")
a = D("a")
f = E("f")
k = F("k")
i = G("i")
m = H("m")
j = I("j")
n = J("n")

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