class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.s: B = None
        self.w: E = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: C = None
        self.q: I = None
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.u: H = None
        self.w: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.s: B = None
        self.w: E = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: C = None
        self.q: I = None
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.u: H = None
        self.w: I = None
        self.txt = txt

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

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

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

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