class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: C = None
        self.q: H = None
        self.o: G = None
        self.y: I = None
        self.x: G = None
        self.u: E = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.p: I = None
        self.q: A = None
        self.u: J = None
        self.z: J = None
        self.o: G = None
        self.v: E = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: I = None
        self.z: C = None
        self.r: I = None
        self.o: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.z: H = None
        self.p: C = None
        self.r: B = None
        self.y: C = None
        self.v: H = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.p: I = None
        self.q: A = None
        self.u: J = None
        self.z: J = None
        self.o: G = None
        self.v: E = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: I = None
        self.z: C = None
        self.r: I = None
        self.o: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.z: H = None
        self.p: C = None
        self.r: B = None
        self.y: C = None
        self.v: H = None
        self.q: F = None
        self.txt = txt

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

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