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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: A = None
        self.y: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: A = None
        self.u: B = None
        self.o: D = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
m = C("m")
n = D("n")
j = E("j")
e = F("e")
b = G("b")
l = H("l")
i = A("i")
g = A("g")

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: A = None
        self.y: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: A = None
        self.u: B = None
        self.o: D = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
m = C("m")
n = D("n")
j = E("j")
e = F("e")
b = G("b")
l = H("l")
i = A("i")
g = A("g")

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