class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: J = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: G = None
        self.y: F = None
        self.t: C = None
        self.r: I = 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.q: H = None
        self.u: H = None
        self.r: F = None
        self.p: H = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: G = None
        self.y: F = None
        self.t: C = None
        self.r: I = 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.q: H = None
        self.u: H = None
        self.r: F = None
        self.p: H = None
        self.w: A = None
        self.txt = txt

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

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