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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.w: I = None
        self.z: D = None
        self.s: F = None
        self.u: F = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: I = None
        self.u: G = None
        self.p: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: A = None
        self.o: J = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.w: I = None
        self.z: D = None
        self.s: F = None
        self.u: F = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: I = None
        self.u: G = None
        self.p: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: A = None
        self.o: J = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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