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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: H = None
        self.r: G = None
        self.t: F = None
        self.p: H = None
        self.o: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: H = None
        self.r: G = None
        self.t: F = None
        self.p: H = None
        self.o: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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