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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.p: H = None
        self.z: F = None
        self.t: H = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: G = None
        self.p: E = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: E = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.txt = txt

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

b = A("b")
i = B("i")
d = C("d")
h = D("h")
a = E("a")
e = F("e")
l = G("l")
m = H("m")
g = I("g")
f = J("f")

b.r = i
b.w = f
b.y = g
i.y = h
i.o = l
i.p = m
i.t = m
i.z = e
i.r = e
i.u = a
d.t = i
d.o = i
d.q = l
d.p = a
d.r = a
h.u = b
h.p = a
h.w = m
a.s = f
a.x = m
e.x = d
e.y = d
e.w = m
e.s = h
l.u = a
l.z = h
l.w = e
m.t = d
g.q = m
g.s = h
f.o = d
f.y = g
assert g.s.p.s.y.s.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: J = None
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.p: H = None
        self.z: F = None
        self.t: H = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: G = None
        self.p: E = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: E = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.txt = txt

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

b = A("b")
i = B("i")
d = C("d")
h = D("h")
a = E("a")
e = F("e")
l = G("l")
m = H("m")
g = I("g")
f = J("f")

b.r = i
b.w = f
b.y = g
i.y = h
i.o = l
i.p = m
i.t = m
i.z = e
i.r = e
i.u = a
d.t = i
d.o = i
d.q = l
d.p = a
d.r = a
h.u = b
h.p = a
h.w = m
a.s = f
a.x = m
e.x = d
e.y = d
e.w = m
e.s = h
l.u = a
l.z = h
l.w = e
m.t = d
g.q = m
g.s = h
f.o = d
f.y = g
assert g.s.p.s.y.s.p.x.txt == "m"