class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: A = None
        self.t: F = None
        self.x: A = None
        self.u: A = None
        self.z: D = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: A = None
        self.t: F = None
        self.x: A = None
        self.u: A = None
        self.z: D = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: D = None
        self.txt = txt

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

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