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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.t: A = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.o: F = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.v: J = None
        self.z: B = None
        self.w: D = None
        self.o: F = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

b.r = a
b.y = k
f.p = g
m.w = d
m.y = d
m.s = g
m.t = b
k.t = e
k.w = e
k.r = c
k.o = c
k.s = c
k.q = f
k.x = m
k.y = j
k.p = g
g.t = k
g.r = k
g.o = c
g.x = b
c.o = f
c.s = m
c.r = d
j.t = k
j.w = k
j.x = b
j.v = e
j.y = e
j.z = f
j.o = c
d.q = j
d.p = c
a.z = d
e.s = m
e.x = f
e.r = a
assert j.w.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.t: A = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.o: F = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.v: J = None
        self.z: B = None
        self.w: D = None
        self.o: F = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

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