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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.v: J = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: C = None
        self.p: H = None
        self.z: B = None
        self.w: A = None
        self.o: I = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.v: J = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: C = None
        self.p: H = None
        self.z: B = None
        self.w: A = None
        self.o: I = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.z: F = None
        self.txt = txt

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

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