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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: C = None
        self.o: A = None
        self.u: B = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.v: D = None
        self.w: B = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
k = C("k")
n = D("n")
d = E("d")
j = F("j")
h = D("h")
g = E("g")
b = C("b")
e = A("e")

a.o = j
a.p = d
m.v = n
m.q = j
k.x = j
k.p = j
k.q = b
k.o = a
k.u = m
k.z = m
n.p = e
n.q = g
n.v = h
n.w = m
d.p = g
d.q = m
d.w = m
j.p = n
j.v = m
h.p = a
h.q = g
h.v = n
h.w = m
g.p = d
g.q = m
g.w = m
b.x = j
b.p = j
b.q = k
b.o = a
b.u = m
b.z = m
e.o = j
e.p = g
assert a.p.w.v.p.p.p.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: C = None
        self.o: A = None
        self.u: B = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.v: D = None
        self.w: B = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
k = C("k")
n = D("n")
d = E("d")
j = F("j")
h = D("h")
g = E("g")
b = C("b")
e = A("e")

a.o = j
a.p = d
m.v = n
m.q = j
k.x = j
k.p = j
k.q = b
k.o = a
k.u = m
k.z = m
n.p = e
n.q = g
n.v = h
n.w = m
d.p = g
d.q = m
d.w = m
j.p = n
j.v = m
h.p = a
h.q = g
h.v = n
h.w = m
g.p = d
g.q = m
g.w = m
b.x = j
b.p = j
b.q = k
b.o = a
b.u = m
b.z = m
e.o = j
e.p = g
assert a.p.w.v.p.p.p.w.v.w.txt == "m"