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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

i = A("i")
g = B("g")
e = C("e")
k = D("k")
m = E("m")
d = F("d")
c = A("c")
n = C("n")

i.o = c
i.w = c
g.q = n
g.y = m
g.p = k
e.x = k
e.o = k
e.q = m
e.u = m
e.p = d
e.s = n
k.z = d
k.u = g
m.y = e
d.y = m
c.o = i
c.w = i
n.x = k
n.o = k
n.q = m
n.u = m
n.p = d
n.s = e
assert d.y.y.u.y.o.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

i = A("i")
g = B("g")
e = C("e")
k = D("k")
m = E("m")
d = F("d")
c = A("c")
n = C("n")

i.o = c
i.w = c
g.q = n
g.y = m
g.p = k
e.x = k
e.o = k
e.q = m
e.u = m
e.p = d
e.s = n
k.z = d
k.u = g
m.y = e
d.y = m
c.o = i
c.w = i
n.x = k
n.o = k
n.q = m
n.u = m
n.p = d
n.s = e
assert d.y.y.u.y.o.u.y.txt == "m"