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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: J = None
        self.r: D = None
        self.s: E = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: E = None
        self.z: I = None
        self.o: F = None
        self.v: G = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: A = None
        self.p: I = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: J = None
        self.r: D = None
        self.s: E = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: E = None
        self.z: I = None
        self.o: F = None
        self.v: G = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: A = None
        self.p: I = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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