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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.u: J = None
        self.p: C = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: G = None
        self.p: J = None
        self.v: B = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: J = None
        self.p: A = None
        self.o: B = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.p: J = None
        self.q: J = None
        self.x: B = None
        self.u: J = None
        self.s: B = None
        self.z: C = None
        self.t: B = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.z: A = None
        self.w: J = None
        self.s: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.u: J = None
        self.p: C = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: G = None
        self.p: J = None
        self.v: B = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: J = None
        self.p: A = None
        self.o: B = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.p: J = None
        self.q: J = None
        self.x: B = None
        self.u: J = None
        self.s: B = None
        self.z: C = None
        self.t: B = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.z: A = None
        self.w: J = None
        self.s: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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