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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: H = None
        self.s: D = None
        self.u: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: D = None
        self.u: J = None
        self.q: J = None
        self.p: I = None
        self.x: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: H = None
        self.s: D = None
        self.u: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: D = None
        self.u: J = None
        self.q: J = None
        self.p: I = None
        self.x: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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