class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: F = None
        self.o: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: E = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.x: E = None
        self.w: A = None
        self.t: E = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: E = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.x: E = None
        self.w: A = None
        self.t: E = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

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