class A:
    def __init__(self, txt: str):
        self.p: J = None
        self.o: E = None
        self.w: C = None
        self.u: F = None
        self.x: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.w: B = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: B = None
        self.q: B = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: B = None
        self.t: H = None
        self.o: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: B = None
        self.y: C = None
        self.z: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.w: B = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: B = None
        self.q: B = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: B = None
        self.t: H = None
        self.o: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: B = None
        self.y: C = None
        self.z: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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