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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: J = None
        self.p: D = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: G = None
        self.y: H = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.v: D = None
        self.y: I = None
        self.u: J = None
        self.r: E = None
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: A = None
        self.w: F = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: J = None
        self.p: D = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: G = None
        self.y: H = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.v: D = None
        self.y: I = None
        self.u: J = None
        self.r: E = None
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: A = None
        self.w: F = None
        self.x: F = None
        self.txt = txt

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

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