class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: H = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: H = None
        self.x: E = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.z: E = None
        self.o: B = None
        self.q: J = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: I = None
        self.v: C = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: B = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: G = None
        self.x: B = None
        self.o: B = None
        self.q: B = None
        self.txt = txt

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

h.s = k
h.q = l
l.r = b
n.w = g
n.o = g
n.q = m
c.s = l
c.v = m
c.x = k
c.r = b
k.r = d
k.v = h
b.w = c
b.y = k
b.z = k
b.o = l
b.u = l
b.q = d
i.o = g
i.y = g
i.v = n
i.x = k
m.o = h
m.u = n
g.p = i
g.w = i
g.v = l
g.t = h
d.s = c
d.t = i
d.x = l
d.o = l
d.q = l
assert g.v.r.q.s.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: H = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: H = None
        self.x: E = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.z: E = None
        self.o: B = None
        self.q: J = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: I = None
        self.v: C = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: B = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: G = None
        self.x: B = None
        self.o: B = None
        self.q: B = None
        self.txt = txt

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

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