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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.v: I = None
        self.y: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: G = None
        self.y: D = None
        self.u: G = None
        self.t: C = None
        self.q: G = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: H = None
        self.v: H = None
        self.q: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.v: I = None
        self.y: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: G = None
        self.y: D = None
        self.u: G = None
        self.t: C = None
        self.q: G = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: H = None
        self.v: H = None
        self.q: E = None
        self.p: G = None
        self.txt = txt

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

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

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