class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.p: G = None
        self.t: F = None
        self.u: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.p: F = None
        self.v: B = None
        self.r: C = None
        self.q: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.p: G = None
        self.t: F = None
        self.u: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.p: F = None
        self.v: B = None
        self.r: C = None
        self.q: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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