class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: I = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: I = None
        self.o: I = None
        self.v: B = None
        self.x: G = None
        self.w: E = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: I = None
        self.o: I = None
        self.v: B = None
        self.x: G = None
        self.w: E = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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