class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: G = None
        self.p: G = None
        self.x: H = None
        self.w: J = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: I = None
        self.o: E = None
        self.u: A = None
        self.z: D = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: E = None
        self.w: G = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: A = None
        self.r: J = None
        self.t: E = None
        self.z: H = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: E = None
        self.u: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.u: J = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: I = None
        self.o: E = None
        self.u: A = None
        self.z: D = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: E = None
        self.w: G = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: A = None
        self.r: J = None
        self.t: E = None
        self.z: H = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: E = None
        self.u: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.u: J = None
        self.r: F = None
        self.txt = txt

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

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

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

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