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

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: D = None
        self.t: A = None
        self.s: J = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: I = None
        self.v: A = None
        self.o: F = None
        self.s: H = None
        self.u: F = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: J = None
        self.p: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: D = None
        self.t: A = None
        self.s: J = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: I = None
        self.v: A = None
        self.o: F = None
        self.s: H = None
        self.u: F = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: J = None
        self.p: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.txt = txt

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

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

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