class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: H = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: H = None
        self.t: C = None
        self.z: A = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.v: I = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.w: B = None
        self.r: H = None
        self.t: J = None
        self.y: B = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: I = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.v: D = None
        self.w: D = None
        self.z: J = None
        self.t: H = None
        self.y: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: B = None
        self.p: F = None
        self.t: B = None
        self.z: F = None
        self.x: B = None
        self.r: B = None
        self.u: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: H = None
        self.t: C = None
        self.z: A = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.v: I = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.w: B = None
        self.r: H = None
        self.t: J = None
        self.y: B = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: I = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.v: D = None
        self.w: D = None
        self.z: J = None
        self.t: H = None
        self.y: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: B = None
        self.p: F = None
        self.t: B = None
        self.z: F = None
        self.x: B = None
        self.r: B = None
        self.u: F = None
        self.txt = txt

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

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