class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: E = None
        self.o: F = None
        self.x: E = None
        self.y: E = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: E = None
        self.o: H = None
        self.v: E = None
        self.s: F = None
        self.w: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: D = None
        self.r: A = None
        self.u: D = None
        self.p: I = None
        self.v: E = None
        self.s: J = None
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.v: F = None
        self.q: G = None
        self.s: J = None
        self.z: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: J = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: D = None
        self.t: C = None
        self.p: H = None
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: E = None
        self.o: H = None
        self.v: E = None
        self.s: F = None
        self.w: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: D = None
        self.r: A = None
        self.u: D = None
        self.p: I = None
        self.v: E = None
        self.s: J = None
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.v: F = None
        self.q: G = None
        self.s: J = None
        self.z: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: J = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: D = None
        self.t: C = None
        self.p: H = None
        self.y: H = None
        self.txt = txt

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

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