class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: D = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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