class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: H = None
        self.p: C = None
        self.t: H = None
        self.u: H = None
        self.q: F = None
        self.s: I = None
        self.x: G = None
        self.r: G = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.z: I = None
        self.u: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.p: C = None
        self.s: F = None
        self.o: G = None
        self.y: J = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: C = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: E = None
        self.o: F = None
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: F = None
        self.txt = txt

a = A("a")
h = B("h")
j = C("j")
n = D("n")
m = E("m")
c = F("c")
l = G("l")
f = H("f")
b = I("b")
i = J("i")

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.z: I = None
        self.u: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.p: C = None
        self.s: F = None
        self.o: G = None
        self.y: J = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: C = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: E = None
        self.o: F = None
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: F = None
        self.txt = txt

a = A("a")
h = B("h")
j = C("j")
n = D("n")
m = E("m")
c = F("c")
l = G("l")
f = H("f")
b = I("b")
i = J("i")

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