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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: H = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: F = None
        self.p: A = None
        self.x: I = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: D = None
        self.t: H = None
        self.v: E = None
        self.x: E = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: I = None
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: H = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: F = None
        self.p: A = None
        self.x: I = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: D = None
        self.t: H = None
        self.v: E = None
        self.x: E = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: I = None
        self.w: C = None
        self.txt = txt

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

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